<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>我的积分 - 社交平台</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4a6cf7;
            --primary-light: #6981f9;
            --secondary: #ff7d00;
            --success: #00b42a;
            --warning: #ff7d00;
            --danger: #f53f3f;
            --text-primary: #1d2129;
            --text-secondary: #4e5969;
            --text-tertiary: #86909c;
            --bg-light: #f2f3f5;
            --bg-white: #ffffff;
            --border-light: #e5e6eb;
            --radius: 10px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--primary);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .nav-title {
            font-size: 18px;
            font-weight: 600;
            color: white;
            text-align: center;
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .nav-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: none;
            border: none;
            color: white;
            font-size: 20px;
        }
        
        /* 积分卡片 */
        .points-card {
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: white;
            border-radius: var(--radius);
            padding: 20px 16px;
            margin: 16px;
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden;
        }
        
        .points-card::before {
            content: '';
            position: absolute;
            top: -20px;
            right: -20px;
            width: 100px;
            height: 100px;
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
        }
        
        .points-card::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: -10px;
            width: 60px;
            height: 60px;
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
        }
        
        .points-title {
            font-size: 14px;
            opacity: 0.9;
            margin-bottom: 8px;
            position: relative;
            z-index: 1;
        }
        
        .points-balance {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 5px;
            position: relative;
            z-index: 1;
        }
        
        .points-expiry {
            font-size: 12px;
            opacity: 0.8;
            margin-bottom: 15px;
            position: relative;
            z-index: 1;
        }
        
        .points-actions {
            display: flex;
            gap: 10px;
            position: relative;
            z-index: 1;
        }
        
        .points-btn {
            flex: 1;
            padding: 8px 0;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 500;
            text-align: center;
            text-decoration: none;
        }
        
        .primary-btn {
            background-color: white;
            color: var(--primary);
        }
        
        .secondary-btn {
            background-color: rgba(255, 255, 255, 0.2);
            color: white;
        }
        
        /* 积分任务 */
        .section {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            margin: 0 16px 16px;
            overflow: hidden;
            box-shadow: var(--shadow);
        }
        
        .section-header {
            padding: 15px 16px;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .section-title {
            font-size: 16px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .section-more {
            font-size: 13px;
            color: var(--text-tertiary);
            text-decoration: none;
        }
        
        .task-list {
            padding: 10px 0;
        }
        
        .task-item {
            padding: 12px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-light);
        }
        
        .task-item:last-child {
            border-bottom: none;
        }
        
        .task-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .task-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            background-color: rgba(74, 108, 247, 0.1);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }
        
        .task-details {
            flex: 1;
        }
        
        .task-title {
            font-size: 15px;
            font-weight: 500;
            margin-bottom: 2px;
        }
        
        .task-desc {
            font-size: 12px;
            color: var(--text-tertiary);
        }
        
        .task-action {
            font-size: 14px;
            padding: 5px 12px;
            border-radius: 15px;
            font-weight: 500;
        }
        
        .task-complete {
            background-color: var(--bg-light);
            color: var(--text-tertiary);
            border: none;
        }
        
        .task-do {
            background-color: var(--primary);
            color: white;
            border: none;
        }
        
        /* 积分记录 */
        .record-tabs {
            display: flex;
            border-bottom: 1px solid var(--border-light);
        }
        
        .record-tab {
            flex: 1;
            text-align: center;
            padding: 12px 0;
            font-size: 15px;
            font-weight: 500;
            color: var(--text-secondary);
            border-bottom: 2px solid transparent;
            text-decoration: none;
        }
        
        .record-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }
        
        .record-list {
            max-height: 300px;
            overflow-y: auto;
        }
        
        .record-item {
            padding: 15px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-light);
        }
        
        .record-item:last-child {
            border-bottom: none;
        }
        
        .record-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .record-icon {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }
        
        .record-income {
            background-color: rgba(0, 180, 42, 0.1);
            color: var(--success);
        }
        
        .record-expense {
            background-color: rgba(245, 63, 63, 0.1);
            color: var(--danger);
        }
        
        .record-details {
            flex: 1;
        }
        
        .record-title {
            font-size: 15px;
            margin-bottom: 3px;
        }
        
        .record-time {
            font-size: 12px;
            color: var(--text-tertiary);
        }
        
        .record-points {
            font-size: 15px;
            font-weight: 500;
        }
        
        .points-income {
            color: var(--success);
        }
        
        .points-expense {
            color: var(--danger);
        }
        
        /* 积分兑换 */
        .exchange-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            padding: 16px;
        }
        
        .exchange-item {
            background-color: var(--bg-light);
            border-radius: var(--radius);
            overflow: hidden;
            text-decoration: none;
            color: var(--text-primary);
        }
        
        .exchange-img {
            width: 100%;
            height: 100px;
            object-fit: cover;
        }
        
        .exchange-info {
            padding: 10px;
        }
        
        .exchange-title {
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 5px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .exchange-points {
            font-size: 14px;
            color: var(--primary);
            font-weight: 600;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-tertiary);
            font-size: 11px;
            gap: 4px;
            text-decoration: none;
            flex: 1;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 20px;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">我的积分</div>
        <button class="nav-btn" id="helpBtn">
            <i class="fas fa-question-circle"></i>
        </button>
    </div>
    
    <!-- 积分卡片 -->
    <div class="points-card">
        <div class="points-title">当前可用积分</div>
        <div class="points-balance">3,580</div>
        <div class="points-expiry">包含 500 积分将于 2023-12-31 过期</div>
        <div class="points-actions">
            <a href="#" class="points-btn primary-btn" id="exchangeBtn">积分兑换</a>
            <a href="#" class="points-btn secondary-btn" id="rulesBtn">积分规则</a>
        </div>
    </div>
    
    <!-- 每日任务 -->
    <div class="section">
        <div class="section-header">
            <div class="section-title">
                <i class="fas fa-tasks" style="color: var(--secondary);"></i>
                每日任务
            </div>
            <a href="#" class="section-more">更多</a>
        </div>
        <div class="task-list">
            <div class="task-item">
                <div class="task-info">
                    <div class="task-icon">
                        <i class="fas fa-sign-in-alt"></i>
                    </div>
                    <div class="task-details">
                        <div class="task-title">每日签到</div>
                        <div class="task-desc">连续签到可获得额外积分</div>
                    </div>
                </div>
                <button class="task-action task-do" data-task="签到">+10积分</button>
            </div>
            <div class="task-item">
                <div class="task-info">
                    <div class="task-icon">
                        <i class="fas fa-comment"></i>
                    </div>
                    <div class="task-details">
                        <div class="task-title">发表评论</div>
                        <div class="task-desc">发布3条有效评论</div>
                    </div>
                </div>
                <button class="task-action task-do" data-task="发表评论">+30积分</button>
            </div>
            <div class="task-item">
                <div class="task-info">
                    <div class="task-icon">
                        <i class="fas fa-share-alt"></i>
                    </div>
                    <div class="task-details">
                        <div class="task-title">分享内容</div>
                        <div class="task-desc">分享1篇内容到朋友圈</div>
                    </div>
                </div>
                <button class="task-action task-complete">已完成</button>
            </div>
            <div class="task-item">
                <div class="task-info">
                    <div class="task-icon">
                        <i class="fas fa-user-plus"></i>
                    </div>
                    <div class="task-details">
                        <div class="task-title">邀请好友</div>
                        <div class="task-desc">成功邀请1位新用户</div>
                    </div>
                </div>
                <button class="task-action task-do" data-task="邀请好友">+200积分</button>
            </div>
        </div>
    </div>
    
    <!-- 积分记录 -->
    <div class="section">
        <div class="section-header">
            <div class="section-title">
                <i class="fas fa-history" style="color: var(--primary);"></i>
                积分记录
            </div>
        </div>
        <div class="record-tabs">
            <a href="#" class="record-tab active">全部</a>
            <a href="#" class="record-tab">收入</a>
            <a href="#" class="record-tab">支出</a>
        </div>
        <div class="record-list">
            <div class="record-item">
                <div class="record-info">
                    <div class="record-icon record-income">
                        <i class="fas fa-plus"></i>
                    </div>
                    <div class="record-details">
                        <div class="record-title">每日签到</div>
                        <div class="record-time">今天 08:30</div>
                    </div>
                </div>
                <div class="record-points points-income">+10</div>
            </div>
            <div class="record-item">
                <div class="record-info">
                    <div class="record-icon record-income">
                        <i class="fas fa-plus"></i>
                    </div>
                    <div class="record-details">
                        <div class="record-title">发表评论</div>
                        <div class="record-time">昨天 15:42</div>
                    </div>
                </div>
                <div class="record-points points-income">+30</div>
            </div>
            <div class="record-item">
                <div class="record-info">
                    <div class="record-icon record-expense">
                        <i class="fas fa-minus"></i>
                    </div>
                    <div class="record-details">
                        <div class="record-title">兑换优惠券</div>
                        <div class="record-time">2023-06-18 10:25</div>
                    </div>
                </div>
                <div class="record-points points-expense">-500</div>
            </div>
            <div class="record-item">
                <div class="record-info">
                    <div class="record-icon record-income">
                        <i class="fas fa-plus"></i>
                    </div>
                    <div class="record-details">
                        <div class="record-title">邀请好友注册</div>
                        <div class="record-time">2023-06-15 09:12</div>
                    </div>
                </div>
                <div class="record-points points-income">+200</div>
            </div>
            <div class="record-item">
                <div class="record-info">
                    <div class="record-icon record-income">
                        <i class="fas fa-plus"></i>
                    </div>
                    <div class="record-details">
                        <div class="record-title">每周活跃奖励</div>
                        <div class="record-time">2023-06-12 18:30</div>
                    </div>
                </div>
                <div class="record-points points-income">+100</div>
            </div>
        </div>
    </div>
    
    <!-- 积分兑换 -->
    <div class="section">
        <div class="section-header">
            <div class="section-title">
                <i class="fas fa-gift" style="color: var(--success);"></i>
                热门兑换
            </div>
            <a href="#" class="section-more">查看全部</a>
        </div>
        <div class="exchange-grid">
            <a href="#" class="exchange-item">
                <img src="https://picsum.photos/id/26/300/200" alt="优惠券" class="exchange-img">
                <div class="exchange-info">
                    <div class="exchange-title">20元无门槛优惠券</div>
                    <div class="exchange-points">500积分</div>
                </div>
            </a>
            <a href="#" class="exchange-item">
                <img src="https://picsum.photos/id/96/300/200" alt="会员" class="exchange-img">
                <div class="exchange-info">
                    <div class="exchange-title">月度会员体验卡</div>
                    <div class="exchange-points">1200积分</div>
                </div>
            </a>
            <a href="#" class="exchange-item">
                <img src="https://picsum.photos/id/24/300/200" alt="实物礼品" class="exchange-img">
                <div class="exchange-info">
                    <div class="exchange-title">定制马克杯</div>
                    <div class="exchange-points">2500积分</div>
                </div>
            </a>
            <a href="#" class="exchange-item">
                <img src="https://picsum.photos/id/65/300/200" alt="抽奖机会" class="exchange-img">
                <div class="exchange-info">
                    <div class="exchange-title">幸运抽奖机会</div>
                    <div class="exchange-points">100积分</div>
                </div>
            </a>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-trophy nav-icon"></i>
            <span>积分</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const helpBtn = document.getElementById('helpBtn');
        const exchangeBtn = document.getElementById('exchangeBtn');
        const rulesBtn = document.getElementById('rulesBtn');
        const taskButtons = document.querySelectorAll('.task-do');
        const recordTabs = document.querySelectorAll('.record-tab');
        const toast = document.getElementById('toast');
        const pointsBalance = document.querySelector('.points-balance');
        
        // 显示提示消息
        function showToast(message) {
            toast.textContent = message;
            toast.classList.add('show');
            
            clearTimeout(toast.timeout);
            toast.timeout = setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
        
        // 绑定事件
        function bindEvents() {
            // 返回按钮
            backBtn.addEventListener('click', () => {
                history.back();
                showToast('返回上一页');
            });
            
            // 帮助按钮
            helpBtn.addEventListener('click', () => {
                showToast('积分帮助中心');
            });
            
            // 积分兑换按钮
            exchangeBtn.addEventListener('click', () => {
                showToast('进入积分兑换中心');
            });
            
            // 积分规则按钮
            rulesBtn.addEventListener('click', () => {
                showToast('查看积分规则说明');
            });
            
            // 任务按钮点击
            taskButtons.forEach(btn => {
                btn.addEventListener('click', function() {
                    const taskName = this.getAttribute('data-task');
                    const points = this.textContent.trim();
                    
                    // 更新按钮状态为已完成
                    this.textContent = '已完成';
                    this.classList.remove('task-do');
                    this.classList.add('task-complete');
                    this.disabled = true;
                    
                    // 显示提示
                    showToast(`完成${taskName}，获得${points}`);
                    
                    // 更新积分余额
                    let currentPoints = parseInt(pointsBalance.textContent.replace(/,/g, ''));
                    const addPoints = parseInt(points);
                    currentPoints += addPoints;
                    pointsBalance.textContent = currentPoints.toLocaleString();
                });
            });
            
            // 记录标签切换
            recordTabs.forEach(tab => {
                tab.addEventListener('click', function(e) {
                    e.preventDefault();
                    
                    // 移除所有标签的active类
                    recordTabs.forEach(t => t.classList.remove('active'));
                    
                    // 给当前点击的标签添加active类
                    this.classList.add('active');
                    
                    // 显示提示
                    showToast(`查看${this.textContent}积分记录`);
                });
            });
        }
        
        // 初始化
        function init() {
            bindEvents();
        }
        
        // 启动
        init();
    </script>
</body>
</html>